import request from '@/utils/request'

// AI海报设计请求参数接口
export interface AiPosterListParams {
  page_no?: number
  page_size?: number
  positive_prompt?: string
  start_time?: string
  end_time?: string
}

// AI海报设计数据接口
export interface AiPosterItem {
  id: number
  positive_prompt: string
  negative_prompt: string
  image_resolution: string
  task_id: string
  task_status: string
  image_url: string
  create_time: string
  update_time: string
}

// AI海报设计列表响应接口
export interface AiPosterListResponse {
  count: number
  lists: AiPosterItem[]
}

// 获取AI海报设计列表
export function getAiPosterList(params: AiPosterListParams): Promise<AiPosterListResponse> {
  return request.get({
    url: '/ai.textToImages/taskList',
    params
  })
}

// 新增AI海报设计
export function addAiPoster(data: Partial<AiPosterItem>): Promise<any> {
  return request.post({
    url: '/ai.textToImages/imageSynthesis',
    data
  })
}

// 删除AI海报设计
export function deleteAiPoster(id: number): Promise<any> {
  return request.post({
    url: '/api/ai-poster/delete',
    data: { id }
  })
} 